/**
 * 
 */
package com.jie.eclipse.pan.utils.help;

import java.util.ArrayList;
import java.util.List;

import com.jie.eclipse.pan.config.BaseConfig;
import com.jie.eclipse.pan.xml.XMLNode;

/**
 * @author yanjie
 *
 */
public class ContentProviderHelper {
	public static XMLNode[] getToolbarButtons(XMLNode toolbar){
		List<XMLNode> list = new ArrayList<XMLNode>();
		String[] actions = {"new","search","save","cancel","delete","copy","start","check","export","print","help"};
		String[] actionTexts = {"新增","查询","存储","取消","删除","复制","送签","签核","导出","列印","帮助"};
		for (int i = 0; i < actions.length; i++) {
			
			String action = actions[i];
			if(!toolbar.gpbv(action+"Disabled",true)){
				XMLNode button = new XMLNode();
				button.spbv(action+"Disabled", toolbar.gpbv(action+"Disabled",true));
				button.spbv(action+"Confirm", toolbar.gpbv(action+"Disabled",false));
				button.spbv(action+"Enab", toolbar.gpbv(action+"Disabled",true));
				button.spsv(BaseConfig.TAG_LABLE, actionTexts[i]);
				list.add(button);
			}
			
		}
		XMLNode[] bts = new XMLNode[list.size()];
		list.toArray(bts);
		return  bts;
	}
}
